package cn.gson.crm.controller.student;

import java.sql.SQLException;
import java.util.List;

import javax.servlet.annotation.WebServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

import cn.gson.crm.controller.BaseServlet;
import cn.gson.crm.model.dao.GraduateDao;
import cn.gson.crm.model.dao.StudentDao;
import cn.gson.crm.model.entity.ClassEntity;
import cn.gson.crm.model.entity.Graduate;
import cn.gson.crm.model.entity.Student;
import cn.gson.crm.vo.CustomVo;
import cn.gson.crm.vo.GraduateVo;

/**
 * 已毕业的学生的维护
 */
@WebServlet("/student/graduate")
public class StudentGraduateSevlet extends BaseServlet {
	private static final long serialVersionUID = 1L;
	private GraduateDao graduateDao=new GraduateDao();

	protected void get(HttpServletRequest request, HttpServletResponse response) throws Exception {
		List<GraduateVo> graduateVos=graduateDao.getAllGraduate();
		request.setAttribute("graduates", graduateVos);
		forward("student/student_graduate.jsp");
	}
//	private void requesetAll(HttpServletRequest request) throws SQLException {
//		List<ClassEntity> classList = classDao.getClassAll();
//		String p = request.getParameter("page");
//		if (p == null || p.isEmpty()) {
//			p = "1";
//		}
//		Integer page = Integer.parseInt(p);
//		// 获得全部信息
//		List<CustomVo> customVoList = customDao.getAllCustomByStatus(3, page);
//		// 总页数
//		int totalPage = customDao.getTotalPage(3);
//		request.setAttribute("queryString", noPageQueryString(request));
//		request.setAttribute("customList", customVoList);
//		request.setAttribute("totalPage", totalPage);
//		request.setAttribute("page", page);
//		request.setAttribute("classList", classList);
//	}
}
